import { createWebHashHistory, createRouter } from 'vue-router'
import Login from '../../views/login/index.vue'
import Main from '../../views/main.vue'
import Admin from '../../views/auth/admin/index.vue'
import Group from '../../views/auth/group/index.vue'
import Dashboard from '../../views/dashboard/index.vue'
import Order from '../../views/vppz/order/index.vue'
import Staff from '../../views/vppz/staff/index.vue'

const routes = [
  {
    path: '/login',
    component:Login,
    name: '登录',
    descripe: '未登录跳转到登录页面'

  },
  {
    path: '/',
    component: Main,
    name: '主页',
    children: [
      {
        path: '/dashboard',
        name: '控制台',
        index:'1',
        icon:'Platform',
        component: Dashboard
      },
      {
        path: '/auth',
        name: '权限管理',
        index:'2',
        icon:'Grid',
        children: [
          {
            path: '/auth/admin',
            name: '账号管理',
            index:'2-1',
            icon:'Avatar',
            component: Admin
          }, 
          {
            path: '/auth/group',
            name: '菜单管理',
            index:'2-2',
            icon:'Menu',
            component: Group
          }
        ]
      },
      {
        path: 'vpzz',
        name: '陪诊管理',
        index:'3',
        icon:'BellFilled',
        children: [
          {
            path: '/vpzz/order',
            name: '订单管理',
            index:'3-1',
            icon:'List',
            component: Order
          },
          {
            path: '/vpzz/staff',
            name: '陪护管理',
            index:'3-2',
            icon:'Checked',
            component: Staff
          }
        ]
      }

    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})
export default router